package com.hotai.controller;

import com.hotai.comment.dtos.ResponseResult;
import com.hotai.comment.pojo.Institution;
import com.hotai.service.InstitutionSerivice;
import com.hotai.vo.courseware.CoursewaredetaileList;
import com.hotai.vo.institulion.InstitutionAddTear;
import com.hotai.vo.institulion.InstitutionDetile;
import com.hotai.vo.institulion.InstitutionList;
import com.hotai.vo.usestudent.UserStudentList;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/Institution")
@CrossOrigin
public class InstitutionController {
    @Autowired
    private InstitutionSerivice institutionSerivice;

    @RequestMapping("/list")
    private ResponseResult InstitutioList(InstitutionList query) {
        return institutionSerivice.InstitutionPage(query);
    }

    @RequestMapping("/detail")
    private ResponseResult Institutiodetail(InstitutionDetile queryware) {
        return institutionSerivice.Institutiondetail(queryware);
    }

    //限制
    @RequestMapping("/xian")
    private ResponseResult InstitutioxianShe(@Param("id") Integer id) {
        return institutionSerivice.InstitutionXian(id);
    }

    //接触限制
    @RequestMapping("/Jiexian")
    private ResponseResult InstitutioxianJie(@Param("id") Integer id) {
        return institutionSerivice.InstitutionJie(id);
    }


    //全选限制
    @RequestMapping("/qxian")
    private ResponseResult InstitutioxianXuan(@Param("ide") String ide) {
        return institutionSerivice.InstitutionXuan(ide);
    }


//
    @RequestMapping("/save")
    private ResponseResult Institutioxsave(@RequestBody Institution institution) {
        return institutionSerivice.Institusave(institution);
    }

    //添加 机构
    @RequestMapping("/Gao")
    private ResponseResult InstitutioGao() {
        return institutionSerivice.InstituGao();
    }


    //添加老师
    @RequestMapping("/addTear")
    private ResponseResult Institutioxsave(@RequestBody @Validated InstitutionAddTear institution) {
        return institutionSerivice.InstituaddTear(institution);
    }

    //重置
    @RequestMapping("/chongZhi")
    private ResponseResult InstitutioxChong(@Param("id") Integer id) {
        return institutionSerivice.InstituaddId(id);
    }


    //数据报表
    @RequestMapping("/xue")
    private ResponseResult xueji() {
        return institutionSerivice.XueTear();
    }





}
